"use client";
import React, { useState } from "react";
import { Calendar } from "antd-mobile";
import dayjs from "dayjs";

const defaultSingle = new Date("2022-03-09");
const defaultRange: [Date, Date] = [
  new Date("2022-03-09"),
  new Date("2022-03-21"),
];

const HomeMobile = function () {
  const today = dayjs();
  const [val, setVal] = useState<[Date, Date] | null>(() => [
    today.subtract(2, "day").toDate(),
    today.add(2, "day").toDate(),
  ]);
  return (
    <>
      <Calendar
        selectionMode="range"
        value={val}
        onChange={(val) => {
          setVal(val);
        }}
      />
    </>
  );
};

export default HomeMobile;
